home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group95b.txt / 000048_icon-group-sender _Sat Jun 17 17:43:19 1995.msg < prev    next >
Internet Message Format  |  1995-09-18  |  4KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 19 Jun 1995 09:02:00 MST
  2. To: icon-group@cs.arizona.edu
  3. Date: Sat, 17 Jun 1995 17:43:19 GMT
  4. From: john@nmt.edu (John Shipman)
  5. Message-Id: <1995Jun17.174319.29735@nmt.edu>
  6. Organization: Zoological Data Processing
  7. Sender: icon-group-request@cs.arizona.edu
  8. References: <1995Jun16.172604.22642@leeds.ac.uk>
  9. Subject: Re: Perl v. Icon
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12. I've been a heavy Icon user for a year or so now, and I think
  13. it's a good choice for text processing applications, especially
  14. when you need a good selection of data structures.
  15.  
  16. Let me give you an example of the sort of thing I do all the
  17. time in Icon, so you can assess whether your needs are similar.
  18.  
  19. Next week I'll be starting a project to display the ``knowledge
  20. base'' of the New Mexico Tech Computer Center staff in two
  21. different forms---as typeset copy and as web pages.
  22.  
  23. The input is a list of skills (C++, hardware repair, etc.),
  24. structured as a three-level hierarchy (major category, minor
  25. category, and skill name), with each skill followed by a list
  26. of people who have that skill, and a rating of B for beginner,
  27. I for intermediate, and E for expert.
  28.  
  29. This input file is to be processed by two different Icon
  30. programs.
  31.  
  32. The first translates the skill list into a fully ruled table
  33. using TeX notation.  The initials of the people are placed
  34. on column headings across the top, and the skills names
  35. are the row headings running down the left side.  At each
  36. cell is the skill level code.
  37.  
  38. The second program will translate the same list into a web
  39. structured in this manner:
  40.  
  41. * The first page will be a bullet list, with links pointing
  42.   to pages for each major skill category (user skills,
  43.   help desk skills, system programming skills).
  44.  
  45. * The major-category pages are bullet lists pointing to
  46.   minor-category pages.  For example, the user page will
  47.   have a bullet for programming languages.
  48.  
  49. * Each minor-category page lists each skills (e.g., C++)
  50.   followed by a list of the experts, the intermediates,
  51.   and the beginners.  Each name on the list is a link to
  52.   a page with name, schedule and contact info for that
  53.   person.
  54.  
  55. Icon is really ideal for this sort of small textual database
  56. application.  Parsing the input file is quite trivial, there's
  57. not much to it.
  58.  
  59. Ideally, though, in order to reuse the part of the program that
  60. parses the input, I want to build an object that represents the
  61. entire knowledge base, and provide methods on that object that
  62. cover the repertoire of functions that the two different
  63. applications will need.  Although Icon is not technically an
  64. object-oriented language, I can still get the kind of
  65. encapsulation and abstraction that I need.
  66.  
  67. Inside the object, I clearly need a heterogeneous tree that
  68. allows me to jump from major category to minor category to skill
  69. to person.  The Icon concept of generators gives me a foolproof
  70. way to allow the caller to visit each child of a parent node, for
  71. example, without having to worry about how the tree is
  72. structured.
  73.  
  74. I must confess that I don't know much Perl.  I have looked at
  75. some scripts a few dozen lines long.  As far as I can tell, the
  76. only reason people put up with the rather ugly and cryptic syntax
  77. of Perl is that it's useful for system administration tasks.  I'm
  78. not a sysadmin; my title is ``Applications Specialist.''
  79.  
  80. As a further disclaimer, I'm rather manic about good style.  I
  81. want my programs to be legible, and I find that Icon gives me
  82. a very natural expression of the problem.  I also find that
  83. modifying programs is straightforward.
  84.  
  85. Since I discovered Icon, I have written negligible amounts of C,
  86. and nothing in Awk.  Most of my work involves transformation of
  87. text input files into text output files (although I have done a
  88. little work with portable binary encodings in files), and I'd say
  89. I'm three times as productive as with C and twice Awk.
  90. -- 
  91. John Shipman (js@cs.nmt.edu)
  92. ``Let's go outside and commiserate with nature.''  --Dave Farber
  93.